<?php
error_reporting(0);
$iid=$_GET['iid'];

include_once 'Taoapi.php';
		        
$Taoapi = new Taoapi;

$Taoapi->method = 'taobao.taobaoke.items.convert';
$Taoapi->fields = 'click_url';
$Taoapi->iids = $iid;
$Taoapi->nick = USERNICK;
$Taoapi->setVersion(2);
$TaobaokeData = $Taoapi->Send('get','xml')->getArrayData();
$url = $TaobaokeData['taobaoke_items']['taobaoke_item']['click_url'];

if (empty($iid)) {
header('Location: /');
exit;
}
header("Location: $url");
exit;

?>
